package com.f6.common.service;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBUtil {

	public static Connection conn ;
	
	public static Connection getConn(){
		if(null==conn){
			try{
				Class.forName("com.mysql.jdbc.Driver");
				conn = DriverManager.getConnection(
						"jdbc:mysql://localhost:3306/f6db?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&rewriteBatchedStatements=TRUE",
						"shi", "root");
			}catch ( Exception e) {
				e.printStackTrace();
			}
			return conn;
		}else{
			return conn;
		}
	}
}
